package de.baumann.browser.present.gg

import de.baumann.browser.api.OdinObserver
import de.baumann.browser.api.net.vo.gg.Morgage
import de.baumann.browser.base.BasePresenter
import de.baumann.browser.iview.gg.IMiningRecordsView
import de.baumann.browser.model.airdropRecord
import de.baumann.browser.utils.getUser

class MiningRecordsPresenter :BasePresenter<IMiningRecordsView>(){

    fun a02(address:String){
        var a = address
        if (a.startsWith("odx")){
            a = "0${address.substring(2)}"
        }
        airdropRecord(a)
                .subscribe(object :OdinObserver<List<Morgage>>(){
                    override fun onSuccess(data: List<Morgage>?) {
                        if (data==null){
                            return
                        }
                        view?.setList(data)
                    }
                })
    }
}